﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;

namespace Tin
{
    class TPoint
    {
        public int Num { set; get; }
        public string Name { set; get; }
        public double X { set; get; }   // X坐标
        public double Y { set; get; }   // Y坐标
        public double Z { set; get; }   // 高程

        public TPoint() { }
        public TPoint(int num, string name, double x, double y, double z)
        {
            Num = num;
            Name = name;
            X = x;
            Y = y;
            Z = z;
        }

        public static bool operator ==(TPoint A, TPoint B)
        {
            if (A.X == B.X && A.Y == B.Y && A.Z == B.Z)
                return true;
            else
                return false;
        }

        public static bool operator !=(TPoint A, TPoint B)
        {
            if (A.X == B.X && A.Y == B.Y && A.Z == B.Z)
                return false;
            else
                return true;
        }

        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public void render(Graphics g)
        {
            float sx = g.Transform.Elements[0];
            float sy = g.Transform.Elements[3];
            Brush brush = new SolidBrush(Color.Red);
            g.FillEllipse(brush, Convert.ToSingle(X - 5 / sx / 2), Convert.ToSingle(Y + 5 / sy / 2), 5 / sx, -5 / sy);

        }
    }
}
